package com.bkd.dreams.client.volunteer;

import com.bkd.dreams.client.volunteer.VolunteerDTO;
import com.google.gwt.cell.client.ActionCell;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;

public class ToggleAdministratorActionCell extends ActionCell<VolunteerDTO> {

	public ToggleAdministratorActionCell(Delegate<VolunteerDTO> delegate) {
		super("",delegate);
	}
	
	@Override
	public void render(Context context, VolunteerDTO value, SafeHtmlBuilder sb) {
	    if(value.isAdministrator()) {
	    	sb.append(SafeHtmlUtils.fromString("Remove Admin Privlages"));
	    } else {
	    	sb.append(SafeHtmlUtils.fromString("Make Administrator"));
	    }
	}	
}
